# Load packages
find_package(Modbus)
find_package(wxWidgets COMPONENTS core base)
include( "${wxWidgets_USE_FILE}" )
find_package(Boost COMPONENTS system thread REQUIRED)

## Configure packages ##

# relax # 
if(${MODBUS_FOUND})
	add_lcv_executable(relax)
	include_directories(${MODBUS_INCLUDE_DIRS})
	target_link_libraries(relax ${MODBUS_LIBRARIES})
else(${MODBUS_FOUND})
	lcv_cannot_build(relax "Tools/relax")
endif(${MODBUS_FOUND})
add_lcv_doc(relax)

if(${wxWidgets_FOUND})
	add_lcv_executable(huniplacer_gui)	
	
	target_link_libraries(huniplacer_gui ${wxWidgets_LIBRARIES})
	
include_directories(${Boost_INCLUDE_DIRS})
	# Add dependencies to our libraries and other ROS packages in the same directory as this one. 
	add_dependencies(huniplacer_gui huniplacer)

	# Include our libraries, they are all exported in Libraries/LibrariesExport.cmake
	include_directories("${LIB_HUNIPLACER_INCLUDE}")

	# Link target to our libraries
	target_link_libraries(huniplacer_gui huniplacer ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY}) 
else(${wxWidgets_FOUND})
	lcv_cannot_build(huniplacer_gui "Tools/huniplacer_gui")
endif(${wxWidgets_FOUND})
add_lcv_doc(huniplacer_gui)

# BlackboardClient demo application
if(PROTOBUF_FOUND)
	include_directories("${LIB_BLACKBOARDCLIENT_INCLUDE}")	
	add_lcv_executable(BlackboardClientDemo)
	add_dependencies(BlackboardClientDemo BlackboardClient)
	target_link_libraries(BlackboardClientDemo BlackboardClient)
else(PROTOBUF_FOUND)
	lcv_cannot_build(BlackboardClientDemo "Tools/BlackboardClientDemo")
endif(PROTOBUF_FOUND)

# Autokeystore demo application #
add_lcv_executable(AutoKeyStoreDemoClient)	
# Include our libraries, they are all exported in Libraries/LibrariesExport.cmake
include_directories("${LIB_AUTOKEYSTORE_INCLUDE}")
# Add dependencies to our libraries and other ROS packages in the same directory as this one. 
add_dependencies(AutoKeyStoreDemoClient AutoKeyStore)
target_link_libraries(AutoKeyStoreDemoClient AutoKeyStore)




